/***************************************************************
 *
 * (c) 2008 Markus Dittrich 
 *
 * This program is free software; you can redistribute it 
 * and/or modify it under the terms of the GNU General Public 
 * License Version 3 as published by the Free Software Foundation. 
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License Version 3 for more details.
 *
 * You should have received a copy of the GNU General Public 
 * License along with this program; if not, write to the Free 
 * Software Foundation, Inc., 59 Temple Place - Suite 330, 
 * Boston, MA 02111-1307, USA.
 *
 ****************************************************************/

#ifndef PLOTPROPERTIES_H
#define PLOTPROPERTIES_H

/* boost includes */
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>

/* STL includes */
#include <vector>

/* Qt includes */
#include <QString>

/* forward declarations */
class QColor;


/* convenience typedefs */
const QString DEFAULT_GRAPH_COLOR("blue");
const QString DEFAULT_PEN_STYLE("circles");


/****************************************************************
 *
 * class ColorList provides a different color on each subsequent 
 * call of get_color(). It is supposed to be statically 
 * inherited by PlotProperties
 *
 ***************************************************************/
class ColorList : public boost::noncopyable
{

public:

  ColorList();

  QString get_color() const;


private:

  std::vector<QString> colorList_;
  mutable int currentColorIndex_;
};
  


/****************************************************************
 *
 * plot_properties hold the properties that determine how a
 * particular data set is being displayed 
 *
 ***************************************************************/
class PlotProperties : public boost::noncopyable
{

public:

  explicit PlotProperties();
  void Init();

  /* getter functions */
  const QColor& get_color() const;
  const QString& get_penStyle() const;
  int get_lineWidth() const;
  int get_circleDiameter() const;
  bool is_hidden() const; 
  
  /* setter functions */
  void set_color(QColor aColor);
  void set_penStyle(QString aPenStyle);
  void set_line_width(int newWidth);
  void set_visibility(bool newState);
  

private:

  /* flags */ 
  bool hidden_;           // graph is hidden (aka not plotted)
                          
  /* data members */
  QColor color_;
  QString penStyle_;

  int lineWidth_;
  int circleDiameter_;

  static ColorList colorList_;
};


/** convenience typedef */
typedef boost::shared_ptr<PlotProperties> PlotPropertiesPtr;



#endif
